import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 房屋信息表分页查询
 * @param {查询条件} data
 */
export function listLayHouse(query) {
  return request({
    url: 'business/LayHouse/list',
    method: 'get',
    params: query,
  })
}
/**
 * 民宿房型树形
 * @param {*} query 
 * @returns 
 */
export function GetTreeLayHouseRoom(query) {
  return request({
    url: 'business/LayHouse/GetTreeLayHouseRoom',
    method: 'get',
    params: query,
  })
}
/**
 * 新增房屋信息表
 * @param data
 */
export function addLayHouse(data) {
  return request({
    url: 'business/LayHouse',
    method: 'post',
    data: data,
  })
}
/**
 * 修改房屋信息表
 * @param data
 */
export function updateLayHouse(data) {
  return request({
    url: 'business/LayHouse',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取房屋信息表详情
 * @param {Id}
 */
export function getLayHouse(id) {
  return request({
    url: 'business/LayHouse/' + id,
    method: 'get'
  })
}

/**
 * 删除房屋信息表
 * @param {主键} pid
 */
export function delLayHouse(pid) {
  return request({
    url: 'business/LayHouse/delete/' + pid,
    method: 'POST'
  })
}
// 导出房屋信息表
export async function exportLayHouse(query) {
  await downFile('business/LayHouse/export', { ...query })
}
